﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="BuscaDoc.aspx.cs" Inherits="DECOR.WebApp.BuscaDoc" Title="Untitled Page" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register assembly="IdeaSparx.CoolControls.Web" namespace="IdeaSparx.CoolControls.Web" tagprefix="cc2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphHeader" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphMainMenu" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphTopMenu" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cphTopContent" runat="server">
</asp:Content>

<asp:Content ID="Content6" ContentPlaceHolderID="cphMain" runat="server">
    <asp:UpdatePanel ID="upMain" runat="server">
<ContentTemplate>
<div style="height:10px"></div>
<table cellpadding="2" cellspacing="0" style="padding-left:10px; padding-right:100px;" class="tbl-detalle">
<tr>
<td style="width: 150px;">Dato para la búsqueda</td>
<td><asp:TextBox ID="txtDatoBusq" runat="server" Width="230px" CssClass="inputbox" ReadOnly="false" AutoPostBack="false" Font-Size="10" />
    <asp:DropDownList ID="cmbTipoDato" runat="server" Width="120">
    </asp:DropDownList>
    </td></tr>
<tr><td>Clase de Documento</td><td><asp:DropDownList ID="cmbClaseDocumento" runat="server" Width="200"></asp:DropDownList></td></tr>
<tr><td>Material</td><td><asp:TextBox ID="txtMaterial" runat="server" Width="100px" MaxLength="10" CssClass="inputbox" ReadOnly="false" AutoPostBack="false" Font-Size="10" /></td></tr>                
<tr><td style="width: 150px;"></td><td><asp:TextBox Visible="false" ID="txtNomCliente" runat="server" Width="250px" CssClass="inputbox" ReadOnly="false" AutoPostBack="false" Font-Size="10" /></td></tr>
<tr><td>Fecha</td><td><asp:TextBox ID="txtFechaInicio" runat="server" Width="70" CssClass="inputbox" ReadOnly="false" AutoPostBack="false" Font-Size="10" /><cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtFechaInicio" Format="dd/MM/yyyy" CssClass="MyCalendar" />a
      <asp:TextBox ID="txtFechaFin" runat="server" Width="70" CssClass="inputbox" ReadOnly="false" AutoPostBack="false" Font-Size="10" />   <cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtFechaFin" Format="dd/MM/yyyy" CssClass="MyCalendar" />&nbsp;&nbsp;<asp:ImageButton ID="ibtnBuscar" runat="server" ImageAlign="Middle" ImageUrl="~/img/find.png" OnClick="ibtnBuscar_Click" /></td></tr><tr>
<td>Estado</td>
<td><asp:CheckBox ID="chkBloqCredito" runat="server" Checked="true" Text="Bloqueado por Credito" />&nbsp;
<asp:CheckBox ID="chkBloqFactura" runat="server" Checked="true" Text="Bloqueado para Factura" /><br />
<asp:CheckBox ID="chkBloqEntrega" runat="server" Checked="true" Text="Bloqueado para Entrega" />&nbsp;
<asp:CheckBox ID="chkConcluido" runat="server" Checked="true" Text="Ped. Concluido" /><br />
<asp:CheckBox ID="chkLiberado" runat="server" Checked="true" Text="Liberado" />
</td>
</tr>
<tr><td>Cod. Asesor</td>
<td><asp:TextBox ID="txtCodVendedor" runat="server" Width="60" MaxLength="8" />
<asp:Label ID="lblTexto" runat="server" Font-Italic="true" Text="Use * para visualizar todos los asesores" />
<cc1:FilteredTextBoxExtender ID="fteCodVendedor" runat="server" TargetControlID="txtCodVendedor"
                FilterType="Numbers,Custom" ValidChars="*" />
</td>
</tr>                
<tr><td>Org. de Ventas</td>
<td><asp:DropDownList ID="cmbOrgVtas" runat="server" Width="200" /></td></tr>
<tr><td>Canal Dist.</td>
<td><asp:DropDownList ID="cmbCanal" runat="server" Width="200" /></td></tr>
<tr><td>Oficina</td>
<td><asp:DropDownList ID="cmbOficina" runat="server" Width="200" /></td></tr>            
</table>
<div style="height:10px"></div>
<cc2:CoolGridView ID="gvPedidos" runat="server" AutoGenerateColumns="false" 
        CssClass="tbl-detalle" Width="978px" OnRowCommand="gvPedidos_RowCommand" 
        GridLines="None" ShowHeader="true" DefaultColumnWidth="870px" Height="350px" 
        AllowPaging="True" onpageindexchanged="Page_Load" 
        onpageindexchanging="gvPedidos_PageIndexChanging" PageSize="12">
<Columns><asp:ButtonField CommandName="Editar" ButtonType="Image" 
        ImageUrl="~/img/edit.png" ShowHeader="true" ItemStyle-HorizontalAlign="Center" 
        ItemStyle-VerticalAlign="Top" ItemStyle-Width="30px" HeaderStyle-Width="30px" >
    <HeaderStyle Width="30px" />
    <ItemStyle HorizontalAlign="Center" VerticalAlign="Top" Width="30px" />
    </asp:ButtonField>
<asp:ButtonField CommandName="Flujo" ButtonType="Image" ImageUrl="~/img/flujo.png" 
        ShowHeader="true" ItemStyle-HorizontalAlign="Center" 
        ItemStyle-VerticalAlign="Top" ItemStyle-Width="30px" 
    HeaderStyle-Width="30px" >
    <HeaderStyle Width="30px" />
    <ItemStyle HorizontalAlign="Center" VerticalAlign="Top" Width="30px" />
    </asp:ButtonField>
<asp:ButtonField CommandName="Detalle" ButtonType="Image" 
        ImageUrl="~/img/detalle.png" ShowHeader="true" 
    ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Top" ItemStyle-Width="30px"
     HeaderStyle-Width="30px" >                        
    <HeaderStyle Width="30px" />
    <ItemStyle HorizontalAlign="Center" VerticalAlign="Top" Width="30px" />
    </asp:ButtonField>
<asp:TemplateField>
<HeaderTemplate>
<table border="0" style="background-color:Transparent;">
    <tr>
        <th style="width:85px;">Doc. Venta</th>
        <th style="width:90px">Cod. Cliente</th>
        <th style="width:310px;">Nombre Cliente</th>
        <th style="width:85px;">NIF</th>
        <th style="width:110px;">Fecha doc.</th>
        <th style="width:110px;">Clase doc.</th>
        <th style="width:110px;">Total</th>
        <th style="width:170px;">Estado</th>
    </tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table border="0" style="background-color:Transparent; margin-left:3px;">
    <tr style="height:5px;" />
    <tr><td style="width:85px;"><asp:Label ID="lblNumPedido" runat="server" Text='<%# Bind("NumPedidoCorto") %>' /></td>
        <td style="width:90px;"><asp:Label ID="Label2" runat="server" Text='<%# Bind("CodClienteCorto") %>' /></td>
        <td style="width:310px;"><asp:Label ID="Label3" runat="server" Text='<%# Bind("DestFactura") %>' /></td>
        <td style="text-align:right; width:85px;"><asp:Label ID="Label4" runat="server" Text='<%# Bind("DestMercaderia") %>' /></td>
        <td style="text-align:center; width:110px;"><asp:Label ID="Label5" runat="server" Text='<%# Bind("FechaString") %>' /></td>
        <td style="width:110px;"><asp:Label ID="Label1" runat="server" Text='<%# Bind("ClaseDocumento") %>' /></td>
        <td style="width:110px;text-align:right"><asp:Label ID="Label7" runat="server" Text='<%# Bind("TotalConIgv", "{0:0,0.00}") %>' /></td>
        <td style="width:170px;text-align:center"><asp:Label ID="Label6" runat="server" Text='<%# Bind("Estado") %>' /></td>
    </tr>
    <tr style="height:5px;" />
    <tr>
        <td colspan="8">
            <asp:GridView ID="gvDetalle" runat="server" AutoGenerateColumns="false" CssClass="tbl-detalle"
                        Width="100%" GridLines="Both" BackColor="Transparent" >
                <Columns>
                    <asp:BoundField DataField="PosicionCorto" HeaderText="Pos." />
                    <asp:BoundField DataField="CodMaterialCorto" HeaderText="Material" />
                    <asp:BoundField DataField="DescMaterial" HeaderText="Denominación" />
                    <asp:BoundField DataField="Cantidad" HeaderText="Cant." DataFormatString="{0:0,0.00}" ItemStyle-HorizontalAlign="Right" />
                    <asp:BoundField DataField="CodUMedida" HeaderText="UM" ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField DataField="FechaEntregaString" HeaderText="F. Reparto" ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField DataField="CantConfirmada" HeaderText="Cant. Conf." DataFormatString="{0:0,0.00}" ItemStyle-HorizontalAlign="Right" />
                    <asp:BoundField DataField="FechaCantConfStr" HeaderText="F. Conf." ItemStyle-HorizontalAlign="Center" />
                    <asp:BoundField DataField="Total" HeaderText="Total" DataFormatString="{0:0,0.00}" ItemStyle-HorizontalAlign="Right" />
                    <asp:BoundField DataField="MotivoRechazo" HeaderText="Mot. Rechazo" />
                </Columns>
            </asp:GridView>
        </td>
    </tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
    <PagerSettings Mode="NumericFirstLast" />
<AlternatingRowStyle BackColor="Beige" />
    <PagerStyle Font-Size="Medium" />
<HeaderStyle BackColor="Silver" Font-Size="12px" Height="20px" />
    <BoundaryStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" />
</cc2:CoolGridView>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="cphFooter" runat="server">
</asp:Content>
